#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>
#include <string.h>
#include <time.h>
#include <fftw3.h>

#define pi 2*acos(0)
#define fmode FFTW_ESTIMATE

typedef struct ctrl_param
{
  char         runname[80];
  int          n_threads, n, kcut, k_power;
  double       t_max, l, h, g, tskip, eps;
  double       cfl, dt, dx, av, k_energy, p_energy, t_energy, h_curr, mean_level;
  double       k_energy_x, steepness;
  fftw_complex *psi,  *z, *dps, *rps, *trpj, *dz, *fps, *fz;

} ctrl_str, *ctrl_ptr;

typedef struct arr2
{
  fftw_complex	*p, *z, *r;

} arr2_str, *arr2_ptr;


/*io.c*/

extern void fload(char** input, ctrl_ptr ptr);
extern void init_io(ctrl_ptr ptr);
extern void term_io();
extern void init_arrays(ctrl_ptr ptr);

/*ffts.c*/

extern void derivative();
extern void init_fft(ctrl_ptr ctrl);
extern void r_transform();
extern void t_transform();
extern void compute_billet(ctrl_ptr in);
extern void rhs_one(ctrl_ptr in, int num);
extern void euler_step(ctrl_ptr in);
extern void put_zero_mode(ctrl_ptr in);


